package cn.medemede;

import java.util.ArrayList;

//管理者，负责保存和返回备忘录
class Charetaker {
    private static ArrayList<Chess> chessList=new ArrayList<>();

    //保存棋子状态
    static void addChess(Chess c){
        chessList.add(c);
    }

    //获取棋子状态
    static Chess getChess(int i){
        int length=chessList.size();
        if(length-i-1<0)
            return chessList.get(0);
        return chessList.get(length-i-1);
    }

}
